/*  1:   */ package org.jetbrains.jps.model.impl;
/*  2:   */ 
/*  3:   */

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.model.*;
import org.jetbrains.jps.model.library.JpsLibrary;
import org.jetbrains.jps.model.library.JpsLibraryCollection;
import org.jetbrains.jps.model.library.JpsLibraryType;
import org.jetbrains.jps.model.library.JpsTypedLibrary;
import org.jetbrains.jps.model.library.impl.JpsLibraryCollectionImpl;
import org.jetbrains.jps.model.library.impl.JpsLibraryRole;
import org.jetbrains.jps.model.library.sdk.JpsSdk;
import org.jetbrains.jps.model.library.sdk.JpsSdkType;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */
/* 12:   */
/* 13:   */
/* 14:   */
/* 15:   */
/* 16:   */
/* 17:   */
/* 18:   */
/* 19:   */
/* 20:   */
/* 21:   */
/* 22:   */
/* 23:   */ 
/* 24:   */ public class JpsGlobalImpl
/* 25:   */   extends JpsRootElementBase<JpsGlobalImpl>
/* 26:   */   implements JpsGlobal
/* 27:   */ {
/* 28:   */   private final JpsLibraryCollectionImpl c;
/* 29:   */   
/* 30:   */   public JpsGlobalImpl(@NotNull JpsModel paramJpsModel, JpsEventDispatcher paramJpsEventDispatcher)
/* 31:   */   {
/* 32:34 */     super(paramJpsModel, paramJpsEventDispatcher);
/* 33:35 */     this.c = new JpsLibraryCollectionImpl((JpsElementCollection)this.myContainer.setChild(JpsLibraryRole.LIBRARIES_COLLECTION_ROLE));
/* 34:36 */     this.myContainer.setChild(JpsFileTypesConfigurationImpl.ROLE, new JpsFileTypesConfigurationImpl());
/* 35:   */   }
/* 36:   */   
/* 37:   */   public JpsGlobalImpl(JpsGlobalImpl paramJpsGlobalImpl, JpsModel paramJpsModel, JpsEventDispatcher paramJpsEventDispatcher)
/* 38:   */   {
/* 39:40 */     super(paramJpsGlobalImpl, paramJpsModel, paramJpsEventDispatcher);
/* 40:41 */     this.c = new JpsLibraryCollectionImpl((JpsElementCollection)this.myContainer.getChild(JpsLibraryRole.LIBRARIES_COLLECTION_ROLE));
/* 41:   */   }
/* 42:   */   
/* 43:   */   @NotNull
/* 44:   */   public <P extends JpsElement, LibraryType extends JpsLibraryType<P>,  extends JpsElementTypeWithDefaultProperties<P>> JpsLibrary addLibrary(@NotNull LibraryType paramLibraryType, @NotNull String paramString)
/* 45:   */   {
/* 46:49 */     if (paramLibraryType == null) {
/* 47:49 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/impl/JpsGlobalImpl", "addLibrary" }));
/* 48:   */     }
/* 49:49 */     if (paramString == null) {
/* 50:49 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/impl/JpsGlobalImpl", "addLibrary" }));
/* 51:   */     }
/* 52:49 */     JpsLibrary tmp89_86 = this.c.addLibrary(paramString, paramLibraryType);
/* 53:49 */     if (tmp89_86 == null) {
/* 54:49 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/impl/JpsGlobalImpl", "addLibrary" }));
/* 55:   */     }
/* 56:49 */     return tmp89_86;
/* 57:   */   }
/* 58:   */   
/* 59:   */   public <P extends JpsElement> JpsTypedLibrary<JpsSdk<P>> addSdk(@NotNull String paramString1, @Nullable String paramString2, @Nullable String paramString3, @NotNull JpsSdkType<P> paramJpsSdkType, @NotNull P paramP)
/* 60:   */   {
/* 61:56 */     if (paramString1 == null) {
/* 62:56 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/impl/JpsGlobalImpl", "addSdk" }));
/* 63:   */     }
/* 64:56 */     if (paramJpsSdkType == null) {
/* 65:56 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "3", "org/jetbrains/jps/model/impl/JpsGlobalImpl", "addSdk" }));
/* 66:   */     }
/* 67:56 */     if (paramP == null) {
/* 68:56 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "4", "org/jetbrains/jps/model/impl/JpsGlobalImpl", "addSdk" }));
/* 69:   */     }
/* 70:56 */     JpsTypedLibrary localJpsTypedLibrary = JpsElementFactory.getInstance().createSdk(paramString1, paramString2, paramString3, paramJpsSdkType, paramP);
/* 71:57 */     this.c.addLibrary(localJpsTypedLibrary);
/* 72:58 */     return localJpsTypedLibrary;
/* 73:   */   }
/* 74:   */   
/* 75:   */   public <P extends JpsElement, SdkType extends JpsSdkType<P>,  extends JpsElementTypeWithDefaultProperties<P>> JpsTypedLibrary<JpsSdk<P>> addSdk(@NotNull String paramString1, @Nullable String paramString2, @Nullable String paramString3, @NotNull SdkType paramSdkType)
/* 76:   */   {
/* 77:64 */     if (paramString1 == null) {
/* 78:64 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/impl/JpsGlobalImpl", "addSdk" }));
/* 79:   */     }
/* 80:64 */     if (paramSdkType == null) {
/* 81:64 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "3", "org/jetbrains/jps/model/impl/JpsGlobalImpl", "addSdk" }));
/* 82:   */     }
/* 83:64 */     return addSdk(paramString1, paramString2, paramString3, paramSdkType, (JpsElement)((JpsElementTypeWithDefaultProperties)paramSdkType).createDefaultProperties());
/* 84:   */   }
/* 85:   */   
/* 86:   */   @NotNull
/* 87:   */   public JpsLibraryCollection getLibraryCollection()
/* 88:   */   {
/* 89:70 */     JpsLibraryCollectionImpl tmp4_1 = this.c;
/* 90:70 */     if (tmp4_1 == null) {
/* 91:70 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/impl/JpsGlobalImpl", "getLibraryCollection" }));
/* 92:   */     }
/* 93:70 */     return tmp4_1;
/* 94:   */   }
/* 95:   */   
/* 96:   */   @NotNull
/* 97:   */   public JpsFileTypesConfiguration getFileTypesConfiguration()
/* 98:   */   {
/* 99:76 */     JpsFileTypesConfiguration tmp13_10 = ((JpsFileTypesConfiguration)this.myContainer.getChild(JpsFileTypesConfigurationImpl.ROLE));
/* :0:76 */     if (tmp13_10 == null) {
/* :1:76 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/impl/JpsGlobalImpl", "getFileTypesConfiguration" }));
/* :2:   */     }
/* :3:76 */     return tmp13_10;
/* :4:   */   }
/* :5:   */   
/* :6:   */   @NotNull
/* :7:   */   public JpsElementReference<JpsGlobal> createReference()
/* :8:   */   {
/* :9:82 */     void tmp7_4 = new JpsGlobalElementReference();
/* ;0:82 */     if (tmp7_4 == null) {
/* ;1:82 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/impl/JpsGlobalImpl", "createReference" }));
/* ;2:   */     }
/* ;3:82 */     return tmp7_4;
/* ;4:   */   }
/* ;5:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.jps.model.impl.JpsGlobalImpl

 * JD-Core Version:    0.7.0.1

 */